<script setup>
const props = defineProps({
  message: String
})

const emit = defineEmits(['submit'])

function sendData() {
  emit('submit', { data: '来自子组件的数据' })
}
</script>

<template>
  <div>
    <p>父组件消息: {{ message }}</p>
    <button @click="sendData">提交数据</button>
  </div>
</template>